package ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.acceptRFCPanel.acceptRFCPanelSubs.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.controller.acceptRFC.ActualiseListsThread;
import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.model.User;
import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.acceptRFCPanel.AcceptRFCPanel;

public class ActaliseListsButtonListener implements ActionListener{

	
	private AcceptRFCPanel acceptRFCPanel;
	private ActualiseListsThread actualiseListsThread;
	private User signedInUser;
	
	public ActaliseListsButtonListener(AcceptRFCPanel acceptRFCPanel){
		this.acceptRFCPanel = acceptRFCPanel;
		this.signedInUser = acceptRFCPanel.getMainframe().getSignedInUser();
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		
		this.actualiseListsThread = new ActualiseListsThread(this.acceptRFCPanel, this.signedInUser);
		this.acceptRFCPanel.getFunctionpanel().getProgress().setVisible(true);
		this.actualiseListsThread.start();
	}

}
